package com.shitou.util;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class NewsTypeTag extends SimpleTagSupport{

	private int type;
	
	@Override
	public void doTag() throws JspException, IOException {
		JspWriter out = getJspContext().getOut();
		if(type == NewsUtil.BUG) {
			out.print("<img width=\"16\" height=\"16\" class=\"tip\" align=\"absmiddle\" src=\"images/bug.png\" title=\"错误\" />");
		} else if(type == NewsUtil.CHAT) {
			out.print("<img width=\"16\" height=\"16\" class=\"tip\" align=\"absmiddle\" src=\"images/chat.png\" title=\"聊天\" />");
		} else if(type == NewsUtil.COMMENTS) {
			out.print("<img width=\"16\" height=\"16\" class=\"tip\" align=\"absmiddle\" src=\"images/comments.png\" title=\"评论\" />");
		} else if(type == NewsUtil.DOCUMENT) {
			out.print("<img width=\"16\" height=\"16\" class=\"tip\" align=\"absmiddle\" src=\"images/doc.png\" title=\"文档\" />");
		} else if(type == NewsUtil.KEY) {
			out.print("<img width=\"16\" height=\"16\" class=\"tip\" align=\"absmiddle\" src=\"images/key.png\" title=\"人员分配\" />");
		} else if(type == NewsUtil.MILESTONE) {
			out.print("<img width=\"16\" height=\"16\" class=\"tip\" align=\"absmiddle\" src=\"images/milestone.png\" title=\"里程碑\" />");
		} else if(type == NewsUtil.PROJECT) {
			out.print("<img width=\"16\" height=\"16\" class=\"tip\" align=\"absmiddle\" src=\"images/project.png\" title=\"工程\" />");
		} else if(type == NewsUtil.SYSTEM) {
			out.print("<img width=\"16\" height=\"16\" class=\"tip\" align=\"absmiddle\" src=\"images/gear.png\" title=\"状态修改\" />");
		} else if(type == NewsUtil.TASK) {
			out.print("<img width=\"16\" height=\"16\" class=\"tip\" align=\"absmiddle\" src=\"images/task.png\" title=\"任务\" />");
		}
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}
	
	
}
